bitkeeper revision 1.1159.258.97 (42603992S3sF-t0yBth7NEBevozVOg)
authorkatzj@redhat.com[iap10] <katzj@redhat.com[iap10]>
Fri, 15 Apr 2005 22:00:50 +0000 (22:00 +0000)
committerkatzj@redhat.com[iap10] <katzj@redhat.com[iap10]>
Fri, 15 Apr 2005 22:00:50 +0000 (22:00 +0000)
[PATCH] Make non-native python path handling a
> > Although I don't really agree with the installing of the
> > python bits to the non-native paths, I can see where it's
> > useful as long as the module ABI doesn't change if you're
> > trying to distribute binary tarballs.  But with the current
> > handling it adds module lookup costs for the native path case
> > (which would be the norm) as well as prevents using
> > PYTHONPATH to look to a different location for the modules.
> >
> > The attached patch changes things so that at first, the xen
> > module is attempted to be imported from the stock paths.  If
> > we get an ImportError exception, then it adds /usr/lib/python
> > to the end of the python path and imports again.
>
> Do you prefer this to just unconditionally addding /usr/lib/python to
> the end of the path rather than the front?

Slightly, but just because having /usr/lib/python in my sys.path is
ugly :-)  I can look over it, though... patch doing that attached

Signed-off-by: Jeremy Katz <katzj@redhat.com>
===== tools/misc/netfix 1.13 vs edited =====

tools/misc/netfix
tools/misc/xend
tools/misc/xensv
tools/misc/xm

index ab5a04cdefc270f1e39e6f4c99150668887a5980..32f1021732750bb26d70484b9239b51bbfa5fa34 100644 (file)
@@ -9,8 +9,8 @@
 
 from getopt import getopt
 
-# Default install path for Xen binary packages.
-sys.path = [ '/usr/lib/python' ] + sys.path
+# add fallback path for non-native python path installs if needed
+sys.path.append('/usr/lib/python')
 from xen.util.Brctl import *
 
 short_options = 'hvqni:b:c'
index d19a4868f6391e0efddc5911b9f4e0c04aa9f4a0..a73ca579a81adea30866e6034d99a9feccf54767 100644 (file)
@@ -22,8 +22,8 @@
 import os
 import sys
 
-# Default install path for Xen binary packages.
-sys.path = [ '/usr/lib/python' ] + sys.path
+# add fallback path for non-native python path installs if needed
+sys.path.append('/usr/lib/python')
 from xen.xend.server import SrvDaemon
 
 class CheckError(ValueError):
index 7924840615a2fef8cfb5cee649904c6e4b9bbb6d..8596457cd7bc886ddb76e419b6cd7d62dc7fcf9c 100755 (executable)
@@ -22,8 +22,8 @@ import os
 import sys
 import re
 
-# Default install path for Xen binary packages.
-sys.path = [ '/usr/lib/python' ] + sys.path
+# add fallback path for non-native python path installs if needed
+sys.path.append('/usr/lib/python')
 from xen.xend.server.params import XEND_PID_FILE
 
 class CheckError(ValueError):
index 86e45573d038c6d7b8a322389078ce399d78ec1d..6bf89313231420099d7609fba627f395c43f727d 100755 (executable)
@@ -2,8 +2,8 @@
 #  -*- mode: python; -*-
 import sys
 
-# Default install path for Xen binary packages.
-sys.path = [ '/usr/lib/python' ] + sys.path
+# add fallback path for non-native python path installs if needed
+sys.path.append('/usr/lib/python')
 from xen.xm import main
 
 main.main(sys.argv)